<?php
/**
 * Created by PhpStorm.
 * User: 小灰灰
 * Date: 2022-06-20
 * Time: 9:40:18
 * Info: 清除缓存
 */

namespace app\common\service;

use support\Cache;

class CacheService
{

    /**
     * 更新菜单缓存
     *
     * @param null $adminId
     *
     * @return bool
     */
    public static function updateMenu($adminId = null)
    {
        if (empty($adminId)) {
            Cache::delete('initAdmin');
        } else {
            Cache::delete('initAdmin_'.$adminId);
        }
        Cache::delete('cacheSystemMenu');

        return true;
    }

    /**
     * 清除系统设置缓存
     * @return bool
     */
    public static function updateSystemConfig()
    {
        Cache::delete('cacheSystemConfig');

        return true;
    }

}
